package app.model;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import javax.sql.DataSource;

import org.rails.core.db.DataSourceHelper;
import org.rails.core.db.SQLHelper;
import org.rails.core.db.SQLTransaction;
import org.rails.core.model.RecordNotFoundException;

import app.helper.ContactHelper;

public class Contact extends ContactHelper {

	public Contact() {
		super();
	}

	public Contact(Object id) throws RecordNotFoundException, SQLException {
		super(id);
	}

	public Contact(Map<String, Object> m) {
		super(m);
	}
	
	public static void main(String[] args) throws SQLException {
		DataSource ds = DataSourceHelper.getSystemDataSource();
		Object[] inp = new Object[]{5,null};
//		List list = SQLHelper.executeProcResult(ds, "test_proc(?,?)",inp,new int[]{1});
//		System.out.println(list);
////		System.out.println(inp[0]);
//		System.out.println(inp[1]);
		SQLTransaction st = new SQLTransaction(ds);
		st.executeProc("test_proc(?,?)",inp,1);

		st.commit();
		System.out.println(inp[0]);
		System.out.println(inp[1]);
		
	}

}
